sudo apt-get install protoc-gen-go
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

#go install \
#    github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \
#    github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \
#    google.golang.org/protobuf/cmd/protoc-gen-go \
#    google.golang.org/grpc/cmd/protoc-gen-go-grpc \
#    github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger

export PATH=$PATH:/home/debi/go/bin

base_dir=$(
  cd "$(dirname "$0")"
  pwd
)
cd $base_dir

function genProto {
  DOMAIN=$1
  PROTO_FILE=$2
  GO_OUT_PATH=$3
  PROTO_PATH=./${DOMAIN}/
  protoc --proto_path=$PROTO_PATH \
    --go_out $GO_OUT_PATH --go_opt paths=source_relative \
    --go-grpc_out $GO_OUT_PATH --go-grpc_opt paths=source_relative \
    ${PROTO_FILE}.proto

}
genProto file auth protobufx